{% extends "./inc/base.html" %}
{% block content %}
                <section class="vbox">
                    <header class="header bg-light dk">
                        <p>{{controller.meta_title}}</p>
                    </header>
                    <section class="scrollable wrapper">

                        <section class="panel panel-default">
                            <div class="table-responsive">
                                <table class="table table-hover b-t b-light">
                                    <thead>
                                    <tr>
                                        <th style="width:60px;" class="text-center">序号</th>
                                        <th>信息编号</th>
                                        <th>发布方类型</th>
                                        <th>发布方电话</th>
                                        <th>发布方姓名</th>
                                        <th>发布方公司名称</th>
                                        <th>商品类别</th>
                                        <th>所在地区</th>
                                        <th>信息类型</th>
                                        <th>申请时间</th>
                                        <th class="text-center">信息详情</th>
                                        <th class="text-center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for item in list %}
                                    <tr >
                                        <td class="text-center">{{loop.index}}</td>
                                        <td><a href="/admin/gongxufabu/see?id={{item.id}}" class="text-info" data-toggle="ajaxModal">{{item.fabu_no}}</a></td>
                                        <td>{{item.fabureninfo.groupid|get_groupname}}</td>
                                        <td>{{item.fabureninfo.mobile}}</td>
                                        <td>{{item.fabureninfo.real_name}}</td>
                                        <td>{{item.fabureninfo.gsmc}}</td>
                                        <td>{{item.shangpingleibie}}</td>
                                        <td>{{item.diqu}}</td>
                                        <td>{{item.xinxileixing|get_gongxutype}}</td>
                                        <td>{{item.chuangjianshijian}}</td>
                                        <td class="text-center"><a href="/admin/gongxufabu/see?id={{item.id}}" class="text-info" data-toggle="ajaxModal">查看</a></td>
                                        <td class="text-center">
                                                {% if item.fabureninfo.groupid !=12 %}<a href="/admin/gongxufabu/push?id={{item.id}}" class="text-info" data-toggle="ajaxModal">推送</a>{%endif%}
                                                <a href="/admin/gongxufabu/sale?id={{item.id}}" class="text-info" data-toggle="ajaxModal">上架</a>
                                                <a href="/admin/gongxufabu/offsale?id={{item.id}}" class="text-info" data-toggle="ajaxModal">退回</a>
                                        </td>
                                    </tr>
                                    {% else %}
                                    <tr><td colspan="12"><div class="alert alert-warning alert-block">
                                        <button data-dismiss="alert" class="close" type="button">×</button>
                                        <p>暂无数据</p>
                                    </div></td></tr>

                                    {% endfor %}


                                    </tbody>
                                </table>
                            </div>
                            <footer class="panel-footer">
                                <div class="row">


                                    <div class="col-sm-12 text-right text-center-xs">
                                        {{pagerData | safe}}
                                    </div>
                                </div>
                            </footer>
                        </section>
                    </section>
                </section>

{% endblock %}
{% block script%}
<script src="/static/admin/js/parsley/parsley.min.js"></script>
<script src="/static/admin/js/parsley/parsley.extend.js"></script>
<script>
    $(function () {
      //搜索功能
      $("#search").click(function(){
        var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
          url += '&' + query;
        }else{
          url += '?' + query;
        }
        window.location.href = url;
      });

      //回车自动提交
      $('.search-form').find('input').keyup(function(event){
        if(event.keyCode===13){
          $("#search").click();
        }
      });

    })
</script>
{% endblock%}
